-- GENERATED SPELL FOR [Sundered Thunderer] --


function spell0_18882(pUnit, Event) --@Summon Sundered Shards,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(35007,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18882', 1, 1)
end

function spell1_18882(pUnit, Event) --@Thunderclap,Self--
pUnit:FullCastSpellOnTarget(8078,pUnit)
pUnit:RegisterEvent('Sorts_18882', 10287, 1)
end

function Sorts_18882(pUnit, Event)
local choix_sorts_18882 = math.random(0, 1)
if choix_sorts_18882 == 0 then
pUnit:RegisterEvent('spell0_18882', 1, 1)
end
if choix_sorts_18882 == 1 then
pUnit:RegisterEvent('spell1_18882', 1, 1)
end
end

function mob18882_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18882', math.random(1500, 3000), 1)
end

function mob18882_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18882_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18882_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18882, 1, 'mob18882_Action')
RegisterUnitEvent(18882, 2, 'mob18882_Leave')
RegisterUnitEvent(18882, 3, 'mob18882_Kill')
RegisterUnitEvent(18882, 4, 'mob18882_Die')
